package org.example.shop.user.service.impl;

import org.example.shop.user.dao.UserDao;
import org.example.shop.entity.User;
import org.example.shop.user.service.UserService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserDao userDao;

    public User findByUid(Integer uid) {
        return userDao.findById(uid).get();
    }

    @Override
    public User save(User user) {
        return userDao.saveAndFlush(user);
    }
}
